<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="redis" uri="http://www.shopjsp.com/redisTag/functions" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${redis:getSysConfig('base_path_back')}"/>
<c:set var="uploadPath" value="${redis:getSysConfig('uploadFileVisitRoot')}"/>
<script type="text/javascript">
    /**
     * 优惠券统计
     */
	<shiro:hasPermission name="back_gotoDiscountCouponPage_couponsInfo">
    function couponsInfo() {
        $.ajax({
            type: "POST",
            dataType: "JSON",
            url: "${basePath}/back/discountCoupon/checkCouponAmount.sjson",
            success: function (result) {
                var data = JSON.parse(result.data);
                if(data.usedCouponAmount==""||data.usedCouponAmount==undefined){
                    $("#d_usedCouponAmount").html("0（元）");
                }else{
                    $("#d_usedCouponAmount").html(data.usedCouponAmount+"（元）");
                }
                if(data.openedCouponAmount==""||data.openedCouponAmount==undefined){
                    $("#d_openedCouponAmount").html("0（元）");
                }else{
                    $("#d_openedCouponAmount").html(data.openedCouponAmount+"（元）");
                }
            }
        });
    }
    </shiro:hasPermission>
</script>

<!--优惠券统计模态框（Modal） -->
<div class="modal fade" id="couponsInfoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog" style="width:70%">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
				<h5 class="modal-title" id="myModalLabel">优惠券统计</h5>
			</div>
			<div class="modal-body">
				<table id="detailTable" align="center" class="addOrEditTable table table-bordered" style="width:100%;">
					<tr>
						<td class="toright_td" width="150px">已发放优惠券金额:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_openedCouponAmount"></span></td>
					</tr>
					<tr>
						<td class="toright_td" width="150px">已使用优惠券金额:</td>
						<td class="toleft_td">&nbsp;&nbsp;<span id="d_usedCouponAmount"></span></td>
					</tr>
				</table>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			</div>
		</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>
